import Service.HouseService;
import Utils.PageSplit;
import entity.House;
import entity.Street;
import entity.Types;
import org.junit.Test;

import java.util.List;

public class testHouse {
    @Test
    public void test1(){
        HouseService houseService = new HouseService();
        PageSplit pageSplit= new PageSplit();

        House house = new House();
        house.setHousePrice(62.0);
        house.setHouseArea(50.0);

        Street street = new Street();
        street.setStreetName("庆丰路");

        Types types = new Types();
        types.setTypeName("一室一厅");

        pageSplit.setCurrentNo(0);
        pageSplit.setPerNum(2);
        pageSplit.setHouse(house);
        pageSplit.setStreet(street);
        pageSplit.setTypes(types);
        pageSplit.setMinPrice(61.0);
        pageSplit.setMaxPrice(500.0);
        pageSplit.setMinArea(30.0);
        pageSplit.setMaxArea(803.0);

        List<House> houseList =  houseService.houseList(pageSplit);
        System.out.println(houseList.size());
        for (House house1 :houseList){
            System.out.println(house1.getHousePrice()+":"+house1.getHouseArea()+"    "+house1.getStreet().getStreetName());
        }
    }
}

